//2009/08/27 15:01:33
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class VerifyCreditCard
{
public:
    string checkDigits(string cardNumber)
    {
		int digit[51];
        int sum = 0;
        for (int i=0; i<cardNumber.size(); i++)
        {
            if (cardNumber.size()%2==0)
                if (i%2==0) digit[i] = (cardNumber[i] - '0') * 2;
                else digit[i] = (cardNumber[i] - '0');
            else
                if (i%2==1) digit[i] = (cardNumber[i] - '0') * 2;
                else digit[i] = (cardNumber[i] - '0');
        }
		for(int i=0; i<cardNumber.size(); i++)
		{
			int a = digit[i] / 10;
			int b = digit[i] % 10;
			sum += a + b;
		}
        if (sum % 10 == 0) return "VALID";
        return "INVALID";
    }
};
